import request from '@/config/axios'

export function useConfigApi() {
    return {
        // 列表
        getList: async (data: any) => {
            return await request.post({url: '/yxt/config/list', data})
        },
        // 查询
        getByKey: async (key: string) => {
            return await request.get({url: '/yxt/config/getByKey?key=' + key})
        },
        // 查询
        getObj: async (id: number) => {
            return await request.get({url: '/yxt/config/get?id=' + id})
        },
        // 更新
        updateObj: (data: any) => {
            return request.post({url: '/yxt/config/update', data})
        },
        //获取升学日期
        getSxRq: () => {
            return request.get({url: '/yxt/config/getSxRq'})
        },
        //设置升学日期
        setSxRq: (data: any) => {
            return request.post({url: '/yxt/config/setSxRq', data})
        }
    }
}
